package com.yanqu.road.entity.activity.douluodalu.data;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.activity.douluodalu.DouLuoDaLuPatronsBattle;
import com.yanqu.road.entity.activity.douluodalu.DouLuoDaLuPatronsBattleEnemy;

import java.util.ArrayList;
import java.util.List;

@FieldTypeAnnotation(tableName = "t_c_douluodalu_patrons_battle")
public class DouLuoDaLuPatronsBattleData extends DataObject {

    @FieldTypeAnnotation(select = true, update = true, desc = "活动ID")
    private int activityId;

    @FieldTypeAnnotation(update = true, desc = "组id")
    private int groupId;

    @FieldTypeAnnotation(update = true, desc = "玩家ID")
    private long userId;

    @FieldTypeAnnotation(desc = "玩家区服ID")
    private long serverId;

    @FieldTypeAnnotation(desc = "玩家活动的总积分-对决")
    private long score;

    @FieldTypeAnnotation(desc = "被打次数(追捕、挑战)")
    private int beHitTimes;

    @FieldTypeAnnotation(desc = "战斗总次数")
    private int allBattleTimes;

    @FieldTypeAnnotation(desc = "最后挑战的玩家ID")
    private long lastEnemyId;

    @FieldTypeAnnotation(desc = "重置时间")
    private long resetTime;

    @FieldTypeAnnotation(desc = "下一个对手ID、系统自动匹配、一直有值")
    private long nextEnemyUserId;

    @FieldTypeAnnotation(desc = "对手ID、追捕/挑战")
    private long captureEnemyUserId;

    @FieldTypeAnnotation(desc = "当前对手ID；派遣或者发起追捕/挑战，触发赋值，代表战斗中")
    private long curEnemyUserId;

    @FieldTypeAnnotation(desc = "战斗类型：1：派遣；2：追捕；3：挑战")
    private int battleType;

    @FieldTypeAnnotation(desc = "战斗是否结束；记着比较稳")
    private boolean battleEnd;

    @FieldTypeAnnotation(desc = "是否全胜，战斗结束时赋值")
    private boolean allWin;

    @FieldTypeAnnotation(desc = "对手-待选门客- curEnemyUserId == 0，发起追捕/挑战，会覆盖该值")
    private List<Integer> randomPatronsList = new ArrayList<>();

    @FieldTypeAnnotation(desc = "我方-阵亡或者战斗中阵容;目前1vN")
    private List<DouLuoDaLuPatronsBattle> battleList = new ArrayList<>();

    @FieldTypeAnnotation(desc = "对手-阵亡或战斗中阵容")
    private List<DouLuoDaLuPatronsBattleEnemy> enemyBattleList = new ArrayList<>();

    //缓存   上次一键挑战的请求时间
    private int lastOneKeyTime;

    public DouLuoDaLuPatronsBattleData() {
    }

    public DouLuoDaLuPatronsBattleData(int activityId, int groupId, long userId) {
        this.activityId = activityId;
        this.groupId = groupId;
        this.userId = userId;
        setInsertOption();
    }

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        if(this.activityId != activityId) {
            this.activityId = activityId;
            setUpdateOption();
        }
    }

    public int getGroupId() {
        return groupId;
    }

    public void setGroupId(int groupId) {
        this.groupId = groupId;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        if(this.userId != userId){
            this.userId = userId;
            setUpdateOption();
        }
    }

    public long getServerId() {
        return serverId;
    }

    public void setServerId(long serverId) {
        if(this.serverId != serverId) {
            this.serverId = serverId;
            setUpdateOption();
        }
    }

    public long getScore() {
        return score;
    }

    public void setScore(long score) {
        if(this.score != score) {
            this.score = score;
            setUpdateOption();
        }
    }

    public int getBeHitTimes() {
        return beHitTimes;
    }

    public void setBeHitTimes(int beHitTimes) {
        if(this.beHitTimes != beHitTimes) {
            this.beHitTimes = beHitTimes;
            setUpdateOption();
        }
    }

    public int getAllBattleTimes() {
        return allBattleTimes;
    }

    public void setAllBattleTimes(int allBattleTimes) {
        if(this.allBattleTimes != allBattleTimes) {
            this.allBattleTimes = allBattleTimes;
            setUpdateOption();
        }
    }

    public long getLastEnemyId() {
        return lastEnemyId;
    }

    public void setLastEnemyId(long lastEnemyId) {
        if(this.lastEnemyId != lastEnemyId) {
            this.lastEnemyId = lastEnemyId;
            setUpdateOption();
        }
    }

    public long getResetTime() {
        return resetTime;
    }

    public void setResetTime(long resetTime) {
        if(this.resetTime != resetTime) {
            this.resetTime = resetTime;
            setUpdateOption();
        }
    }

    public long getNextEnemyUserId() {
        return nextEnemyUserId;
    }

    public void setNextEnemyUserId(long nextEnemyUserId) {
        if(this.nextEnemyUserId != nextEnemyUserId) {
            this.nextEnemyUserId = nextEnemyUserId;
            setUpdateOption();
        }
    }

    public long getCaptureEnemyUserId() {
        return captureEnemyUserId;
    }

    public void setCaptureEnemyUserId(long captureEnemyUserId) {
        if(this.captureEnemyUserId != captureEnemyUserId) {
            this.captureEnemyUserId = captureEnemyUserId;
            setUpdateOption();
        }
    }

    public long getCurEnemyUserId() {
        return curEnemyUserId;
    }

    public void setCurEnemyUserId(long curEnemyUserId) {
        if(this.curEnemyUserId != curEnemyUserId) {
            this.curEnemyUserId = curEnemyUserId;
            setUpdateOption();
        }
    }

    public int getBattleType() {
        return battleType;
    }

    public void setBattleType(int battleType) {
        if(this.battleType != battleType) {
            this.battleType = battleType;
            setUpdateOption();
        }
    }

    public boolean isBattleEnd() {
        return battleEnd;
    }

    public void setBattleEnd(boolean battleEnd) {
        if(this.battleEnd != battleEnd) {
            this.battleEnd = battleEnd;
            setUpdateOption();
        }
    }

    public boolean isAllWin() {
        return allWin;
    }

    public void setAllWin(boolean allWin) {
        if(this.allWin != allWin) {
            this.allWin = allWin;
            setUpdateOption();
        }
    }

    public List<Integer> getRandomPatronsList() {
        return randomPatronsList;
    }

    public void setRandomPatronsList(List<Integer> randomPatronsList) {
        this.randomPatronsList = randomPatronsList;
        setUpdateOption();
    }

    public List<DouLuoDaLuPatronsBattle> getBattleList() {
        return battleList;
    }

    public void setBattleList(List<DouLuoDaLuPatronsBattle> battleList) {
        this.battleList = battleList;
        setUpdateOption();
    }

    public List<DouLuoDaLuPatronsBattleEnemy> getEnemyBattleList() {
        return enemyBattleList;
    }

    public void setEnemyBattleList(List<DouLuoDaLuPatronsBattleEnemy> enemyBattleList) {
        this.enemyBattleList = enemyBattleList;
        setUpdateOption();
    }


    //缓存
    public int getLastOneKeyTime() {
        return lastOneKeyTime;
    }

    public void setLastOneKeyTime(int lastOneKeyTime) {
        this.lastOneKeyTime = lastOneKeyTime;
    }
}
